﻿@model RestApp.UI.Models.User

@{
	ViewBag.Title = "Graphic";
}

@System.Web.Optimization.Styles.Render("~/bundles/calendarStyles")

<h2>@Model.LastName @Model.FirstName @Model.MiddleName</h2>

@Html.HiddenFor(model => model.Id)

<div id="calendar"></div>

<div id="addEvent" class="modal fade bs-example-modal-sm" aria-labelledby="mySmallModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="exampleModalLabel">Добавление времени работы</h4>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group">
                        <label for="recipient-name" class="control-label">Время начала работы</label>
                        <div class="input-group clockpicker" data-placement="left" data-align="top" data-autoclose="true">
                            <input type="text" class="form-control" value="9:00" id="startWorkTime" readonly>
                            <span class="input-group-addon">
                                <span class="glyphicon glyphicon-time"></span>
                            </span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="message-text" class="control-label">Время окончания работы</label>
                        <div class="input-group clockpicker" data-placement="left" data-align="top" data-autoclose="true">
                            <input type="text" class="form-control" value="18:00" id="endWorkTime" readonly>
                            <span class="input-group-addon">
                                <span class="glyphicon glyphicon-time"></span>
                            </span>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer" id="addButtons">
                <button type="button" class="btn btn-default" data-dismiss="modal">Закрыть</button>
                <button type="button" class="btn btn-primary" id="addEventClick">Добавить</button>
            </div>

            <div id="editButtons" class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Закрыть</button>
                <button type="button" class="btn btn-primary" id="editEvent">Сохранить</button>
                <button type="button" class="btn btn-danger" id="removeEvent">Удалить</button>
            </div>

        </div>
    </div>
</div>

@section scripts{

   @System.Web.Optimization.Scripts.Render("~/bundles/calendar")
    <script>
        var addEventUrl = "@Url.Action("AddGraphic", "Calendar")"
            , editEventUrl = "@Url.Action("EditGraphic", "Calendar")"
            , removeEventUrl = "@Url.Action("Remove", "Calendar")"
            , currentDate = "@DateTime.Now.Month" + "-" + "@DateTime.Now.Day" + "-" + "@DateTime.Now.Year"
            , eventsListUrl = "/RestApp.UI/api/Graphics"
            , checkIfEventExists = "@Url.Action("CheckIfEventExists", "Calendar")"
            , canEdit = @User.IsInRole("Manager").ToString().ToLower();
    </script>
}

